import dayjs from "dayjs"
import relativeTime from "dayjs/plugin/relativeTime"
import "dayjs/locale/zh-cn"

dayjs.locale("zh-cn")

dayjs.extend(relativeTime)

export const fromTime = (time) => {
    const now = dayjs(time).fromNow()
    return now === '几秒前' ? '刚刚' : now
}
